package com.lobo.blog.mappers;

import com.lobo.blog.entity.Tag;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @authoer:MacieSerenity
 * @createDate: 2022/9/29
 * @description:
 */
@Mapper
@Transactional
public interface TagsMapper {

    Tag findTagByName(@Param("tagName") String tagName);

    int addNewTag(@Param("tag") Tag tag);

    int updateTagDeletedStatusToTrue(@Param("tag") Tag tag);

    int updateTagDeletedStatusToFalse(@Param("tag") Tag type);

    int updateTag(@Param("tag") Tag type);

    Tag getTagById(@Param("tagId") Integer tagId);

    List<Tag> getTagByIds(@Param("tagsId") String tagsId);

    List<Tag> getAllTagByList();

    int deleteTagById(@Param("tagId") Integer tagId);

    List<String> getAlltags();

    List<Tag> getTopSizeTag(@Param("size") Integer size);
}
